<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.hnluchuan.staff.dto.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@include file="/common/head.jsp" %>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <form action="${ctx }/admin/employee/infoadd?id=${n.id }" id="detail-form" class="form-horizontal" method="post" enctype="multipart/form-data">
        <div align="center" >员工基本信息</div>
        <div class="form-group">
            <!-- 用户ID -->
            <%--<label class="col-sm-2 control-label">用户ID</label>--%>
            <%--<div class="col-sm-4">--%>
            <input type="hidden" id="user-id" name="user.id" value="${n.user.id }" class="form-control">
            <input type="hidden"  placeholder="请选择用户ID" class="form-control" id="user-name" value="${n.user.id }"
                   onclick="bring({
                           url:'${ctx}/admin/user/search',
                           name: 'id',
                           idInput: 'user-id',
                           nameInput: 'user-name'
                           })" />

            <%--</div>--%>
            <!-- 岗位 -->
            <label class="col-sm-2 control-label">岗位</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="position" name="position" value="${n.position }">
            </div>
            <!-- 岗位 -->
            <label class="col-sm-2 control-label">部门</label>
            <div class="col-sm-4">
                <select name="department.id"  class="form-control">
                    <c:forEach items="${delist}" var="n" varStatus="idx">
                        <option value="${n.id}">${n.name}</option>
                    </c:forEach>
                </select>
            </div>
        </div>

        <div class="form-group">

            <!-- 姓名 -->
            <label class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="name" name="name" value="${n.name }">
            </div>

            <!-- 出生日期 -->
            <label class="col-sm-2 control-label">出生日期</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="birth" name="birth" value="<fmt:formatDate value='${n.birth }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
            </div>
        </div>
        <div class="form-group">

            <!-- 性别 -->
            <label class="col-sm-2 control-label">性别</label>
            <div class="col-sm-4">
                <c:if test="${n.sex==1}">
                    男<input type="radio" id="sex" name="sex" value="1"   checked="checked">
                    女<input type="radio" id="sex" name="sex" value="0"  >
                </c:if>
                <c:if test="${n.sex==0}">
                    男<input type="radio" id="sex" name="sex" value="1" >
                    女<input type="radio" id="sex" name="sex" value="0" checked="checked">
                </c:if>
                <c:if test="${n.sex==null}">
                    男<input type="radio" id="sex" name="sex" value="1" >
                    女<input type="radio" id="sex" name="sex" value="0" checked="checked">
                </c:if>
                <%--<input type="text" class="form-control" name="sex" value="${n.sex }">--%>
            </div>

            <!-- 身高 -->
            <label class="col-sm-2 control-label">身高</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" placeholder="厘米" id="height" name="height" value="${n.height }">
            </div>
        </div>
        <div class="form-group">

            <!-- 体重 -->
            <label class="col-sm-2 control-label">体重</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" placeholder="公斤" id="weight" name="weight" value="${n.weight }">
            </div>

            <!-- 籍贯 -->
            <label class="col-sm-2 control-label">籍贯</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="place" name="place" value="${n.place }">
            </div>
        </div>
        <div class="form-group">

            <!-- 民族 -->
            <label class="col-sm-2 control-label">民族</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="nation" name="nation" value="${n.nation }">
            </div>

            <!-- 联系电话 -->
            <label class="col-sm-2 control-label">联系电话</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="phone" name="phone" value="${n.phone }">
            </div>
        </div>
        <div class="form-group">

            <!-- 身份证号 -->
            <label class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="iDCard" name="iDCard" value="${n.IDCard }">
            </div>

            <!-- 毕业学校 -->
            <label class="col-sm-2 control-label">毕业学校</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="school" name="school" value="${n.school }">
            </div>
        </div>
        <div class="form-group">

            <!-- 专业 -->
            <label class="col-sm-2 control-label">专业</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="major" name="major" value="${n.major }">
            </div>

            <!-- 学历 -->
            <label class="col-sm-2 control-label">学历</label>
            <div class="col-sm-4">
                <%--<input type="text" class="form-control" name="education" value="${n.education }">--%>
                <select name="education"  class="form-control">
                    <option value="1">大专</option>
                    <option value="2">本科</option>
                    <option value="3">研究生</option>
                </select>
            </div>
        </div>
        <div class="form-group">

            <!-- 户口所在地 -->
            <label class="col-sm-2 control-label">户口所在地</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="location" name="location" value="${n.location }">
            </div>

            <!-- 居住地址 -->
            <label class="col-sm-2 control-label">居住地址</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="address" name="address" value="${n.address }">
            </div>
        </div>
        <div class="form-group">

            <!-- 微信号 -->
            <label class="col-sm-2 control-label">微信号</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="wechat" name="wechat" value="${n.wechat }">
            </div>

            <!-- 邮箱 -->
            <label class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="email" name="email" value="${n.email }">
            </div>
        </div>
        <div class="form-group">

            <!-- 婚姻状况 -->
            <label class="col-sm-2 control-label">婚姻状况</label>
            <div class="col-sm-4">
                <%--<input type="text" class="form-control" id="marry" name="marry" value="${n.marry }">--%>
                <select name="marry"  class="form-control">
                    <option value="1">已婚</option>
                    <option value="2">未婚</option>
                </select>

            </div>

            <!-- 入职时间 -->
            <label class="col-sm-2 control-label">入职时间</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="inTime" name="inTime" value="<fmt:formatDate value='${n.inTime }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
            </div>
        </div>
            <%
            Integer type=(Integer) request.getAttribute("type");
            if(type==1)
            {
        %>
        <div class="form-group">

            <!-- 员工状态/1.录用/2.停职 -->
            <label class="col-sm-2 control-label">员工状态/1.录用/2.停职3.转正</label>
            <div class="col-sm-4">
                ${enum:detail('EmployeeStatus', 'status', n.status)}
            </div>

        </div>
            <%

        }else
        {
        %>

        <div class="form-group">
            <!-- 员工状态/1.录用/2.停职 -->
            <div class="col-sm-4">
                <input type="hidden" class="form-control"  value="${n.status}" />
            </div>

        </div>
            <%
            }%>


        <a class="btn btn-primary addexperience" data-align="center">增加工作经验</a>

        <script>
            var b=1;
            $(function(){
                $('.addexperience').click(function(){
                    var test =document.getElementsByName("name").valueOf();
                    if(!!!test){alert('请输入姓名!.');return false;}
                    switch(b)
                    {
                        case 1:
                            document.getElementById("experience1").style.display="";
                            break;
                        case 2:
                            document.getElementById("experience2").style.display="";
                            break;
                        case  3: alert("最多两条！！");
                        default:
                    }
                    b++;
                });
            })
        </script>

        <div1 id="experience1" style="display:none">


            <div class="form-group">
                <label class="col-sm-2 control-label">工作经验</label>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">离职原因</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].reason" value="${n.reason }">
                </div>
                <!-- 单位 -->
                <label class="col-sm-2 control-label">单位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].company" value="${n.company }">
                </div>
            </div>
            <div class="form-group">
                <!-- 工作 -->
                <label class="col-sm-2 control-label">工作</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].work" value="${n.work }">
                </div>
                <!-- 职位 -->
                <label class="col-sm-2 control-label">职位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].position" value="${n.position }">
                </div>
            </div>
            <div class="form-group">
                <!-- 工作起始时间 -->
                <label class="col-sm-2 control-label">工作起始时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].start" value="<fmt:formatDate value='${n.start }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
                <!-- 工作结束时间 -->
                <label class="col-sm-2 control-label">工作结束时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[0].end" value="<fmt:formatDate value='${n.end }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
            </div>

        </div1>






        <div1 style="display:none" id="experience2">


            <div class="form-group">
                <label class="col-sm-2 control-label">工作经验</label>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">离职原因</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].reason" value="${n.reason }">
                </div>
                <!-- 单位 -->
                <label class="col-sm-2 control-label">单位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].company" value="${n.company }">
                </div>
            </div>
            <div class="form-group">
                <!-- 工作 -->
                <label class="col-sm-2 control-label">工作</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].work" value="${n.work }">
                </div>
                <!-- 职位 -->
                <label class="col-sm-2 control-label">职位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].position" value="${n.position }">
                </div>
            </div>
            <div class="form-group">
                <!-- 工作起始时间 -->
                <label class="col-sm-2 control-label">工作起始时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].start" value="<fmt:formatDate value='${n.start }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
                <!-- 工作结束时间 -->
                <label class="col-sm-2 control-label">工作结束时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="experienceDTOS[1].end" value="<fmt:formatDate value='${n.end }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
            </div>


        </div1>






































        <a class="btn btn-primary addrecord">增加学历信息</a>

        <script>
            var a=1;
            $(function(){
                $('.addrecord').click(function(){
                    switch(a)
                    {
                        case 1:
                            document.getElementById("record1").style.display="";
                            break;
                        case 2:
                            document.getElementById("record2").style.display="";
                            break;
                        case  3: alert("最多两条！！");
                        default:
                    }
                    a++;
                });
            })

        </script>
        <div1 id="record1" style="display:none">
            <div class="form-group">
                <label class="col-sm-2 control-label">学历</label>
            </div>

            <!-- 学历 -->
            <div class="form-group">
                <label class="col-sm-2 control-label" >学历</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[0].record" value="${n.record }">
                </div>
                <label class="col-sm-2 control-label">学习起始时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[0].start" value="<fmt:formatDate value='${n.start }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
            </div>
            <div class="form-group">

                <!-- 学习结束时间 -->
                <label class="col-sm-2 control-label">学习结束时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[0].end" value="<fmt:formatDate value='${n.end }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>

                <!-- 专业 -->
                <label class="col-sm-2 control-label">专业</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[0].major" value="${n.major }">
                </div>
            </div>
            <div class="form-group">
                <!-- 证书 -->
                <label class="col-sm-2 control-label">证书</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[0].certificate" value="${n.certificate }">
                </div>
            </div>
        </div1>


        <div1 id="record2" style="display:none">
            <div class="form-group">
                <label class="col-sm-2 control-label">学历</label>
            </div>
            <!-- 学历 -->
            <div class="form-group">
                <label class="col-sm-2 control-label">学历</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[1].record" value="${n.record }">
                </div>
                <label class="col-sm-2 control-label">学习起始时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[1].start" value="<fmt:formatDate value='${n.start }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>
            </div>
            <div class="form-group">

                <!-- 学习结束时间 -->
                <label class="col-sm-2 control-label">学习结束时间</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[1].end" value="<fmt:formatDate value='${n.end }' pattern='yyyy-MM-dd'/>" onclick="laydate({format: ''})">
                </div>

                <!-- 专业 -->
                <label class="col-sm-2 control-label">专业</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[1].major" value="${n.major }">
                </div>
            </div>
            <div class="form-group">
                <!-- 证书 -->
                <label class="col-sm-2 control-label">证书</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="educationsDTOS[1].certificate" value="${n.certificate }">
                </div>
            </div>
        </div1>











        <a class="btn btn-primary addurgency">增加紧急联系人</a>

        <script>
            var c=1;
            $(function(){
                $('.addurgency').click(function(){
                    switch(c)
                    {
                        case 1:
                            document.getElementById("urgency1").style.display="";
                            break;
                        case 2:
                            document.getElementById("urgency2").style.display="";
                            break;
                        case  3: alert("最多两条！！");
                        default:
                    }
                    c++;
                });
            })
        </script>


        <!-- 紧急联系人-->
        <div1 id="urgency1" style="display:none">
            <div class="form-group">
                <label class="col-sm-2 control-label" >紧急联系人</label>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[0].name" value="${n.name }">
                </div>
                <!-- 关系 -->
                <label class="col-sm-2 control-label">关系</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[0].relation" value="${n.relation }">
                </div>
            </div>
            <div class="form-group">
                <!-- 联系电话 -->
                <label class="col-sm-2 control-label">联系电话</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[0].phone" value="${n.phone }">
                </div>
                <!-- 单位或住址 -->
                <label class="col-sm-2 control-label">单位或住址</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[0].address" value="${n.address }">
                </div>
            </div>
        </div1>




        <!-- 紧急联系人-->
        <div1 id="urgency2" style="display:none">
            <div class="form-group">
                <label class="col-sm-2 control-label" >紧急联系人</label>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[1].name" value="${n.name }">
                </div>
                <!-- 关系 -->
                <label class="col-sm-2 control-label">关系</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[1].relation" value="${n.relation }">
                </div>
            </div>
            <div class="form-group">
                <!-- 联系电话 -->
                <label class="col-sm-2 control-label">联系电话</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[1].phone" value="${n.phone }">
                </div>
                <!-- 单位或住址 -->
                <label class="col-sm-2 control-label">单位或住址</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="emergencyContactDTOS[1].address" value="${n.address }">
                </div>
            </div>
        </div1>








        <a class="btn btn-primary addfamily">家庭联系人</a>


        <script>
            var d=1;
            $(function(){
                $('.addfamily').click(function(){
                    switch(d)
                    {
                        case 1:
                            document.getElementById("family1").style.display="";
                            break;
                        case 2:
                            document.getElementById("family2").style.display="";
                            break;
                        case  3: alert("最多两条！！");
                        default:
                    }
                    d++;
                });
            })
        </script>
        <div1 id="family1" style="display:none">

            <div class="form-group">
                <label class="col-sm-2 control-label" >家庭联系人</label>
            </div>

            <div class="form-group">
                <!-- 姓名 -->
                <label class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].name" value="${n.name }">
                </div>
            </div>
            <div class="form-group">

                <!-- 关系 -->
                <label class="col-sm-2 control-label">关系</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].relation" value="${n.relation }">
                </div>

                <!-- 联系方式 -->
                <label class="col-sm-2 control-label">联系方式</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].contact" value="${n.contact }">
                </div>
            </div>
            <div class="form-group">

                <!-- 年龄 -->
                <label class="col-sm-2 control-label">年龄</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].age" value="${n.age }">
                </div>

                <!-- 工作单位 -->
                <label class="col-sm-2 control-label">工作单位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].company" value="${n.company }">
                </div>
            </div>
            <div class="form-group">

                <!-- 职位 -->
                <label class="col-sm-2 control-label">职位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[0].position" value="${n.position }">
                </div>

            </div>


        </div1>
        <div1 id="family2" style="display:none">

            <div class="form-group">
                <label class="col-sm-2 control-label" >家庭联系人</label>
            </div>

            <div class="form-group">
                <!-- 姓名 -->
                <label class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].name" value="${n.name }">
                </div>
            </div>
            <div class="form-group">

                <!-- 关系 -->
                <label class="col-sm-2 control-label">关系</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].relation" value="${n.relation }">
                </div>

                <!-- 联系方式 -->
                <label class="col-sm-2 control-label">联系方式</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].contact" value="${n.contact }">
                </div>
            </div>
            <div class="form-group">

                <!-- 年龄 -->
                <label class="col-sm-2 control-label">年龄</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].age" value="${n.age }">
                </div>

                <!-- 工作单位 -->
                <label class="col-sm-2 control-label">工作单位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].company" value="${n.company }">
                </div>
            </div>
            <div class="form-group">

                <!-- 职位 -->
                <label class="col-sm-2 control-label">职位</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="familyDTOS[1].position" value="${n.position }">
                </div>

            </div>
        </div1>




        <%@include file="/common/foot.jsp" %>




</body>
</html>
